package com.yan.design.two.behavior.s6;

import java.util.HashMap;
import java.util.Map;

/**
 * 6. 中介者模式
 *      中介类
 * @author shengren.yan
 * @create 2022-08-10
 */
public class Mediator {

    // 地产中介
    private final Map<String,User> userMap = new HashMap<>();

    // 注册
    public void register(String address,User u){
        userMap.put(address,u);
    }

    // 查询
    public User find(String address){
        return userMap.get(address);
    }

}
